import Base from './base'

const keywordApi = '/detailApi'
const detailApi = '/detailApi'
const newApi = '/detailApi'

const categoryApi = '/categoryApi'
const hotApi = '/hotApi'

class Wallpaper extends Base {
  // 搜索
  getSearch (start, count, keyword) {
    return this.httpGet(`${keywordApi}?c=WallPaper&a=search&start=${start}&count=${count}&kw=${keyword}`)
  }

  // 最新壁纸
  getNewWallPaper (start, count) {
    return this.httpGet(`${newApi}?c=WallPaper&a=getAppsByOrder&order=create_time&start=${start}&count=${count}&from=360chrome`)
  }

  // 壁纸分类
  getAllCategory () {
    return this.httpGet(`${categoryApi}?c=WallPaper&a=getAllCategoriesV2&from=360chrome`)
  }

  // 壁纸分类详情
  getCategoryDetail (cid, start, count) {
    return this.httpGet(`${detailApi}?c=WallPaper&a=getAppsByCategory&cid=${cid}&start=${start}&count=${count}&from=360chrome`)
  }

  // 获取今日热门
  getHotWallPaper () {
    return this.httpGet(`${hotApi}?cid=36&start=0&count=30`)
  }
}

export default new Wallpaper()